home *** CD-ROM | disk | FTP | other *** search
/ Total Network Tools 2002 / NextStepPublishing-TotalNetworkTools2002-Win95.iso / Archive / Misc Servers / Zope.exe / DTML-WITH.STX < prev    next >
Encoding:
Text File  |  2000-10-12  |  1.2 KB  |  48 lines

  1. with: Controls DTML variable look up
  2.  
  3.   The 'with' tag pushes an object onto the DTML namespace. Variables
  4.   will be looked up in the pushed object first.
  5.  
  6.   Syntax
  7.  
  8.     <dtml-with Variable|expr="Expression">
  9.     </dtml-with>
  10.  
  11.     The 'with' tag is a block tag. It pushes the named variable or
  12.     variable expression onto the DTML namespace for the duration of
  13.     the 'with' block. Thus names are looked up in the pushed object
  14.     first. 
  15.  
  16.   Attributes
  17.  
  18.     only -- Limits the DTML namespace to only include the one defined
  19.     in the 'with' tag.
  20.  
  21.     mapping -- Indicates that the variable or expression is a mapping
  22.     object. This ensures that variables are looked up correctly in the
  23.     mapping object.
  24.  
  25.   Examples
  26.  
  27.     Looking up a variable in the REQUEST::
  28.  
  29.       <dtml-with REQUEST only>
  30.         <dtml-if id>
  31.           <dtml-var id>
  32.         <dtml-else>
  33.           'id' was not in the request.
  34.         </dtml-if>
  35.       </dtml-with>
  36.  
  37.     Pushing the first child on the DTML namespace::
  38.  
  39.       <dtml-with expr="objectValues()[0]">
  40.         First child's id: <dtml-var id>
  41.       </dtml-with>
  42.  
  43.   See Also
  44.  
  45.     "let tag"dtml-let.stx
  46.  
  47.  
  48.